<?php
mysql_select_db($database_drycleaners_conn, $drycleaners_conn);
$query_get_order_item = "SELECT 
	   unit_of_measure.name as 
	   unit_name,order_item.id as pr_id,
       item.name as item_name,
       order_item.qty_required,
	   order_item.qty_recieved,
       order_item.amount
  	  FROM
	  (drycleaners.order_item order_item
      INNER JOIN
              drycleaners.item item
      ON 
	  (order_item.item_id = item.id))
      INNER JOIN
      drycleaners.unit_of_measure unit_of_measure
      ON (order_item.unit_of_measure_id = unit_of_measure.id)
	  Where order_item.pr_id='".$_REQUEST['purchase_req_id']."'";
$get_order_item = mysql_query($query_get_order_item, $drycleaners_conn) or die(mysql_error());
$row_get_order_item = mysql_fetch_assoc($get_order_item);
$totalRows_get_order_item = mysql_num_rows($get_order_item);
?>
<?php include"includes/table_settings.php"?>
<div><a href=".?purchase_req_recieve_view"><input name="add" type="submit" value="Back to Receive	" id="add_forms"/></a>
</div> 
              <table cellpadding="0" cellspacing="0" border="0" id="dataTable">
                <thead>
                  <tr>
                    <th>Id</th>
                    <th>Item</th>
                    <th>Unit</th>
                    <th>Qty Required</th>
                    <th>Qty Received</th>
                    <th>Amount</th>
                    <th></th>
                  </tr>
                </thead>
                <tbody>
                  <!--Loop start, you could use a repeat region here-->
  <?php do{?>
    <!--Loop start, you could use a repeat region here-->
    <tr>
      <td><?php echo $row_get_order_item['pr_id']?></td>
      <td><?php echo $row_get_order_item['item_name']?></td>
      <td><?php echo $row_get_order_item['unit_name']?></td>
      <td><?php echo $row_get_order_item['qty_required']?></td>
      <td><?php echo $row_get_order_item['qty_recieved']?></td>
      <td><?php echo $row_get_order_item['amount']?></td>
      <td>
<?php 
if($row_get_branch_req_item['qty_recieved']!=""){
	echo"Received";
}
else{
echo"<a href='.?order_item_id=".$row_get_order_item['pr_id']."&amp;order_item_recieve= true&amp;purchase_req_id=".$_REQUEST['purchase_req_id']."&action=Receive'>Receive</a>";
}
?></td>
    </tr>
    <?php }while($row_get_order_item=mysql_fetch_assoc($get_order_item));?>
                  <!--Loop end-->
                </tbody>
              </table>
        	</div>
<div class="tab_column" id="form_area">
          </div>         
     	</div>     
</div>
<?php
mysql_free_result($get_order_item);
?>